package com.bjpowernode.boss.convert.help;

import cn.hutool.core.util.StrUtil;
import com.bjpowernode.boss.common.enums.PublicStatus;
import org.mapstruct.Named;
import org.springframework.stereotype.Component;

@Component
public class CommonFun {

    //自定义处理方法
    @Named("transPublicStatus")
    public  String transPublicStatus(String status){
        if(StrUtil.isBlank(status)){
            return "";
        }
        try{
            //将string转为PublicStatus枚举对象
            PublicStatus publicStatus = PublicStatus.valueOf(status);
            return publicStatus.getMsg();
        }catch (Exception e){
            e.printStackTrace();
        }
        return "未知";
    }
}
